1. Field of the Invention
The present invention relates to an electronic apparatus such as a one-chip microcomputer incorporated within an electronic device, for example.
2. Description of the Related Art
A one-chip microcomputer incorporated within an electronic device, for example, is formed of an electronic apparatus in which a fixed memory means (ROM (read only memory)), a processing means (CPU (central processing unit)), an input means, and a variable memory means (RAM (random access memory)), etc., are unitarily integrated.
In such an electronic apparatus (one-chip microcomputer), a program to be executed by the processing means (CPU) is stored in the fixed memory means (ROM), for example. Such an electronic apparatus can be made inexpensively by means of mass-production.
One-chip microcomputers are incorporated within electronic devices such as consumer VTR's (video tape recorder) having a built-in camera, compact video deck or the like. There is a recent trend that these electronic devices are designed so as to have multiple functions in order to discriminate products. As a result, the amount of information (processing program) stored in the fixed memory means (ROM) is increased and, particularly, the processing program becomes extremely long, which unavoidably causes defects (bugs) to occur.
When such a bug is discovered after the apparatuses have been mass-produced, these already mass-produced apparatuses must be abandoned and the apparatus must be mass-produced again, at great expense. Further, external parts for patching the bug must be mounted on the apparatus. Also, it is frequently observed that external parts cannot be substantially mounted on electronic device because various parts were already mounted on the electronic device with high density.
The assignee of the present application has previously proposed a means for patching a bug after the apparatus was mass-produced (see Japanese Patent Application No. 3-118799). According to this previously-proposed application, in the electronic apparatus, there are provided a patch information memory means for patching a bug and an access switching means. A bug portion is discriminated on the basis of an information stored in a fixed memory means. At that bug portion, the memory access is switched from the fixed memory means to the patch information memory means.
In this previously-proposed apparatus, when an information (processing program) stored in the fixed memory means (ROM) is constantly accessed in a predetermined sequential order, if the next patch portion is designated at the end of the processing where an arbitrary patch portion is patched, then a plurality of bug portions can be patched sequentially.
In this previously-proposed apparatus, however, when other, different information is accessed by an interruption or the like, a bug in such different information cannot be patched. More specifically, when a portion to be patched in the first interrupt processing is designated at the beginning of the interrupt processing, for example, the timing at which this interrupt processing itself is executed in the main processing is not specified and the portion to be patched when the interrupt processing is ended becomes different depending on the timing of the interrupt processing. Consequently, the next portion to be patched cannot be designated.
To solve the above problem, according to the prior art, there are provided a patch information memory means and an access switching means for the interrupt processing independently of those of the main processing, whereby a bug can be patched during the interrupt processing. However, this prior art apparatus needs many additional circuits. Further, when the interrupt processing is executed in a multiple fashion, there are needed a maximum number of sets of patch information memory means and access switching means, which cannot be effected with ease.